package com.itheima.mapper;

import com.itheima.pojo.Member;
import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface MemberMapper {
    /**
     * 根据身份证号查询会员信息
     * @param idCard
     * @return
     */
    @Select("select * from t_member where idCard = #{idCard}")
    Member selectByIdCard(String idCard);

    /**
     * 添加会员
     * @param order
     */
    Order addmember(Order order);

    /**
     * 通过手机号添加会员
     * @param phoneNumber
     */
    @Select("insert into t_member(phoneNumber) values(#{phoneNumber})")
    void add(String phoneNumber);

    /**
     * 通过手机号获取会员信息
     * @return
     */
    @Select("select * from t_member where phoneNumber = #{phoneNumber}")
    Member selectByPhone(String phoneNumber);
}
